From 0c5181056d0977bbb63e34df941a3665a65a50b4 Mon Sep 17 00:00:00 2001
From: Santo Cariotti <santo@dcariotti.me>
Date: Sun, 20 Oct 2024 22:23:59 +0200
Subject: New notification fields

---
 app/(tabs)/notifications/[id].tsx | 27 ++++++++-------------------
 1 file changed, 8 insertions(+), 19 deletions(-)

(limited to 'app/(tabs)/notifications/[id].tsx')

diff --git a/app/(tabs)/notifications/[id].tsx b/app/(tabs)/notifications/[id].tsx
index 4ec6f1a..42e743d 100644
--- a/app/(tabs)/notifications/[id].tsx
+++ b/app/(tabs)/notifications/[id].tsx
@@ -24,19 +24,11 @@ interface AlertData {
   areaLevel3: string;
 }
 
-interface PositionData {
-  id: string;
-  userId: string;
-  createdAt: string;
-  latitude: number;
-  longitude: number;
-  movingActivity: string;
-}
-
 interface NotificationData {
   id: string;
   alert: AlertData;
-  position: PositionData;
+  userId: string;
+  movingActivity: string;
   seen: boolean;
   level: string;
   createdAt: string;
@@ -130,14 +122,11 @@ export default function NotificationIdScreen() {
             'Content-Type': 'application/json',
           },
           body: JSON.stringify({
-            query: `{ notifications(id: ${id}) {
-             id,
-             alert { id, userId, createdAt, area, areaLevel2, areaLevel3, reachedUsers },
-             position {id, userId, createdAt, latitude, longitude, movingActivity},
-             seen,
-             level,
-             createdAt
-            } }`,
+            query: `{notifications(id: ${id}) {
+                id,
+                alert { id, userId, createdAt, area, areaLevel2, areaLevel3, text1, text2, text3, reachedUsers },
+                userId, latitude, longitude, movingActivity, level, seen, createdAt
+            }}`,
           }),
         }
       );
@@ -176,7 +165,7 @@ export default function NotificationIdScreen() {
           }));
 
 
-        setCoordinates({ latitude: notificationData.position.latitude, longitude: notificationData.position.longitude });
+        setCoordinates({ latitude: notificationData.latitude, longitude: notificationData.longitude });
         setNotification(notificationData);
         setPolygon(coordinates);
         setLevel2Polygon(level2Coordinates);
-- 
cgit v1.2.3-71-g8e6c

